package com.ke.controller;

import com.ke.pojo.BaseResp;
import com.ke.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author bochen
 */
@RestController
@RequestMapping("/shop")
@CrossOrigin(allowCredentials = "true")
public class ShopController {
    @Autowired
    ShopService shopService;
    @RequestMapping("/findProductById/{id}")
    public BaseResp findProductById(@PathVariable("id")Integer id){
        return shopService.findProductById(id);
    }
    @RequestMapping("/findAll/{page}/{size}")
    public BaseResp findAll(@PathVariable("page")Integer page,@PathVariable("size")Integer size){
        return shopService.findAll(page,size);
    }

}
